package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.DeliveryAddressMapper;
import com.foreknow.elmboot.po.DeliveryAddress;
import com.foreknow.elmboot.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeliveryAddressServiceImpl implements DeliveryAddressService {
    @Autowired
    private DeliveryAddressMapper deliveryAddressMapper;
    @Override
    public DeliveryAddress queryAddressByDaId(Integer daId) {
        return deliveryAddressMapper.queryAddressByDaId(daId);
    }

    @Override
    public List<DeliveryAddress> queryAddressByUserId(String userId) {
        return deliveryAddressMapper.queryAddressByUserId(userId);
    }

    @Override
    public int addAddress(DeliveryAddress deliveryAddress) {
        return deliveryAddressMapper.addAddress(deliveryAddress);
    }

    @Override
    public int deleteAddress(Integer daId) {
        return deliveryAddressMapper.deleteAddress(daId);
    }

    @Override
    public int updateAddress(DeliveryAddress deliveryAddress) {
        return deliveryAddressMapper.updateAddress(deliveryAddress);
    }
}
